package com.vonchange.purchase.good.service.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.vonchange.headb.core.map.HeaMap;
import com.vonchange.purchase.good.bean.Good;
import com.vonchange.purchase.good.dao.IGoodDao;
import com.vonchange.purchase.good.service.IGoodService;
import com.vonchange.purchase.merchant.bean.Merchant;
import com.vonchange.utils.crud.dao.IBaseDao;
import com.vonchange.utils.crud.service.normal.impl.BaseServiceImpl;
@Service
@Transactional
public class GoodServiceImpl extends BaseServiceImpl<Good> implements IGoodService{
	@Resource
    private IGoodDao goodDao;
	@Override
	public IBaseDao<Good> getDao() {
		return goodDao;
	}
	public void initSave(Merchant entity) {
		entity.setCreateTime(new Date());
	}
	public void initUpdate(Merchant entity) {
		entity.setUpdateTime(new Date());
	}
	public void initFind(HeaMap parameter) {
		if(null==parameter){
			parameter=new HeaMap();
		}
		if(null==parameter.get("isDelete_eq")){
			parameter.set("isDelete_eq", 0);
		}
	}

}
